<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>1</title>
	</head>
	<body>
		<input type="text" id="text" value="" />
		<button>确定</button>
		<hr />
		<div id="div1">
			提示：范围是1~100
		</div>
		
		<script src="/bck/static/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			sessionStorage.setItem("min",1);
			sessionStorage.setItem("max",100);
			sessionStorage.setItem("sfsj","yaosj");
			sessionStorage.setItem("c","c");
			$(document).ready(function(){
				$("button").click(function(){
					 $.ajax({
			            type:"post",
			            url:"/ajax.php?ajax=cai",
			            data:{
			                te:$('#text').val(),
			                min:sessionStorage.getItem("min"),
			                max:sessionStorage.getItem("max"),
			                c:sessionStorage.getItem("c"),
			                s:sessionStorage.getItem("sfsj")
			            },
			            dataType:'json',
			            success:function(mgs){
			                if(mgs.gx=="恭喜猜中了"){
			                	alert(mgs.gx);
			                }
			               if(mgs.min!=null){
			               		sessionStorage.setItem("min",mgs.min);
			               }
			               if(mgs.max!=null){
			               	sessionStorage.setItem("max",mgs.max);
			               }
			               sessionStorage.setItem("sfsj",mgs.s);
			               sessionStorage.setItem("c",mgs.c);
			               $("#div1").html("提示：范围是"+sessionStorage.getItem("min")+"~"+sessionStorage.getItem("max"));
			               console.log(mgs.c);
			            }
					});
				});
			});
		</script>
	</body>
</html>
